<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Goods/index')}">商品列表</a></li>
        <li><a href="{:url('Goods/add')}">添加商品</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="get" action="{:url('Goods/index')}">
        <input type="text" class="form-control" name="keyword" style="width: 200px;" value="{:input('request.keyword/s','')}" placeholder="请输入商品名称">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('Goods/index')}">清空</a >
    </form>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
                <th>ID</th>
                <th>商品名称</th>
                <th>商品图</th>
                <th>商品图集</th>
                <th>商品标题</th>
                <th>自营状态</th>
                <th>运费</th>
                <th>商品状态</th>
                <th>分类</th>
                <th>跳转链接</th>
                <th>发布时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="v">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value=""></td>
                    <td>{$v.id}</td>
                    <td>{$v.name}</td>
                    <td><img src="{$v.image}" class="img-thumbnail js-image-previewer" style="width: 80px;height: 50px"></td>
                    <td>
                        <foreach name="$v['photos']" item="v">
                            <img src="/upload/{$v}" style="width: 40px">
                        </foreach>
                    </td>
                    <td>{$v.title}</td>
                    <td>
                        <switch name="$v.zy">
                            <case value="1">
                                <a href="{:url('Goods/isShow',array('id'=>$v['id']))}" class="js-ajax-dialog-btn" data-msg="确定隐藏吗？">
                                    <span class="btn btn-success btn-xs" >显示</span>
                                    <a href="{:url('Goods/isShow',array('id'=>$v['id']))}" class="js-ajax-dialog-btn" data-msg="确定不是自营吗？">
                                        <span class="btn btn-success btn-xs" >是</span>
                                    </a>
                                </a>
                            </case>
                            <case value="0">
                                <a href="{:url('Goods/isShow',array('id'=>$v['id']))}" class="js-ajax-dialog-btn" data-msg="确定显示吗？">
                                    <span class="btn btn-success btn-danger btn-xs" >隐藏</span>
                                    <a href="{:url('Goods/isShow',array('id'=>$v['id']))}" class="js-ajax-dialog-btn" data-msg="确定是自营吗？">
                                        <span class="btn btn-success btn-danger btn-xs" >否</span>
                                    </a>
                                </a>
                            </case>
                        </switch>
                    </td>
                    <td>{$v.yf}</td>
                    <td>
                        <switch name="$v.status">
                            <case value="1">
                                <span class="btn btn-success btn-xs">正常</span>
                            </case>
                            <case value="2">
                                <span class="btn btn-warning btn-xs">下架</span>
                            </case>
                            <case value="0">
                                <span class="btn btn-danger btn-xs">无货</span>
                            </case>
                        </switch>
                    </td>
                    <td>{$v.gid}</td>
                    <td>{$v.url}</td>
                    <td>{$v.create_time}</td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="{:url('Goods/edit',array('id'=>$v['id']))}">{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Goods/delete',array('id'=>$v['id']))}">
                            {:lang('DELETE')}
                        </a>
                        <div class="btn-group" role="group">
                            <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                商品配置<span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="javascript:void(0);" onclick="openIframeLayer('setGoodsAttr?goods_id={$v.id}','配置商品属性',{area:['60%','80%']})">
                                        配置属性
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" onclick="openIframeLayer('setGoodsAttrValue?goods_id={$v.id}','配置商品属性值',{area:['60%','80%']})">
                                        配置属性值
                                    </a>
                                </li>
                            </ul>
                        </div>

                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div>
            共有{$list->total()}条数据，每页显示{$list->listRows()}条，当前第{$list->currentPage()}页，共{$list->lastPage()}页
        </div>
        <div class="pagination">{$list->render()}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/js-image-previewer.js"></script>
</body>
</html>